package com.rwy.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.rwy.dto.user.UserDTO;

@Mapper
public interface UserManageDaoMapper {

	
	@Select("select a.memberID, b.NickName, b.BusinessPartnerID,  a.OpenID,a.HeadImgUrl,a.Province,a.City " +
			" FROM User_WeiXinMember a INNER JOIN Admin_Administrator b  ON a.MemberID = b.MemberID  WHERE a.OpenID = #{openID} and a.isEnabled = 1 and b.isEnabled = 1 ")
	public UserDTO getBusinessPartnerMesByOpenID(@Param("openID")String openID);
	
	@Select("select phoneNumber, BusinessPartnerID, userName, NickName FROM  Admin_Administrator where phoneNumber = #{mobile} ")
	public UserDTO getBusinessPartnerByMObile(@Param("mobile") String mobile);
	
	@Select("select BusinessPartnerID from  CRM_BusinessPartner where ParentID = #{parentID} ")
	public List<Integer> getChildPartnerIDByParentID(@Param("parentID") Integer parentId);
}
